<form class="forminfo" id="updateForm">
    <div class="form-group">
        <label class="col-sm-2 control-label">用户账号</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="account" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">用户姓名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="name" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">用户密码</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="password" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">创建时间</label>
        <div class="col-sm-10">
            <input type="date" class="form-control" id="createDate" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">锁定状态</label>
        <div class="col-sm-10">
            <input  type="radio" onclick="check(this)" name="stateCode" class="status" id="1" value="1"/>否&nbsp;&nbsp;&nbsp;&nbsp;<input  type="radio" value="2" onclick="check(this)" id="2" class="status"  name="stateCode"/>是
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">权限选择</label>
        <div class="col-sm-10">
            <input name="power" type="checkbox" value="1001" id="admin" class="manager"/>管理员&nbsp;&nbsp;&nbsp;&nbsp;<input name="power" type="checkbox" value="1002"  id="sell"/>销售&nbsp;&nbsp;&nbsp;&nbsp;<input name="power" type="checkbox" value="1003" id="procurement" />采购&nbsp;&nbsp;&nbsp;&nbsp;<input name="power" type="checkbox" value="1004"  id="finance"/>财务&nbsp;&nbsp;&nbsp;&nbsp;<input name="power" type="checkbox" id="1005" value="1005" />仓管
        </div>
    </div>
</form>
<script type="text/javascript">

   $(function(){
        $(".manager").change(function(){
            $(".forminfo :checkbox:gt(0)").prop('checked',$(this).prop('checked'));
        });

        $('.forminfo :checkbox:gt(0)').change(function(){
            $('.manager').prop('checked',$('.forminfo :checkbox:gt(0):not(:checked)').length>0?false:true);
        })
    })
    function check(obj) {
        $(".status").attr('checked',false);
        $(obj).attr('checked',true);
    }

    var defaultDate = document.querySelectorAll('.date-picker');
    for (var i = 0; i<defaultDate.length; i++) {
        defaultDate[i].valueAsDate = new Date();
    }
</script>